/**
 * Created by Administrator on 2016/12/23.
 */
//图片资源
let imgSrcArr = [
  { name: "bg", src: "img/bg.jpg" },

  { name: "fish1", src: "img/fish1.png" },
  { name: "fish2", src: "img/fish2.png" },
  { name: "fish3", src: "img/fish3.png" },
  { name: "fish4", src: "img/fish4.png" },
  { name: "fish5", src: "img/fish5.png" },
  { name: "fish6", src: "img/fish6.png" },
  { name: "fish7", src: "img/fish7.png" },
  { name: "fish8", src: "img/fish8.png" },
  { name: "fish9", src: "img/fish9.png" },
  { name: "fish10", src: "img/fish10.png" },

  { name: "bottom-bar", src: "img/bottom-bar.png" },
  { name: "bottom-num", src: "img/bottom-num.png" },
  { name: "energy-bar", src: "img/energy-bar.png" },

  { name: "cannon_minus", src: "img/cannon_minus.png" },
  { name: "cannon_minus_down", src: "img/cannon_minus_down.png" },
  { name: "cannon_plus", src: "img/cannon_plus.png" },
  { name: "cannon_plus_down", src: "img/cannon_plus_down.png" },
  { name: "cannon1", src: "img/cannon1.png" },
  { name: "cannon2", src: "img/cannon2.png" },
  { name: "cannon3", src: "img/cannon3.png" },
  { name: "cannon4", src: "img/cannon4.png" },
  { name: "cannon5", src: "img/cannon5.png" },
  { name: "cannon6", src: "img/cannon6.png" },
  { name: "cannon7", src: "img/cannon7.png" },

  { name: "bullet1", src: "img/bullet1.png" },
  { name: "bullet2", src: "img/bullet2.png" },
  { name: "bullet3", src: "img/bullet3.png" },
  { name: "bullet4", src: "img/bullet4.png" },
  { name: "bullet5", src: "img/bullet5.png" },
  { name: "bullet6", src: "img/bullet6.png" },
  { name: "bullet7", src: "img/bullet7.png" },

  { name: "coinAni1", src: "img/coinAni1.png" },
  { name: "coinAni2", src: "img/coinAni2.png" },
  { name: "coinText", src: "img/coinText.png" },
];

// 鱼的属性设置
let flashAtt = {
  fish1: {
    width: 55,
    height: 37,
    speed: 3.2,
    cost: 5,
    sumFrame: 8,
    // 出现频率
    pro: 0.7,
  },
  fish2: {
    width: 78,
    height: 64,
    speed: 2.9,
    cost: 15,
    sumFrame: 8,
    pro: 0.75,
  },
  fish3: { width: 72, height: 56, speed: 2.5, cost: 25, sumFrame: 8, pro: 0.8 },
  fish4: {
    width: 77,
    height: 59,
    speed: 1.2,
    cost: 35,
    sumFrame: 8,
    pro: 0.85,
  },
  fish5: {
    width: 107,
    height: 122,
    speed: 1.1,
    cost: 45,
    sumFrame: 8,
    pro: 0.9,
  },
  fish6: {
    width: 105,
    height: 79,
    speed: 1.4,
    cost: 40,
    sumFrame: 12,
    pro: 0.92,
  },
  fish7: {
    width: 92,
    height: 151,
    speed: 1.6,
    cost: 30,
    sumFrame: 10,
    pro: 0.94,
  },
  fish8: {
    width: 174,
    height: 126,
    speed: 1.6,
    cost: 50,
    sumFrame: 12,
    pro: 0.96,
  },
  fish9: {
    width: 166,
    height: 183,
    speed: 2.2,
    cost: 70,
    sumFrame: 12,
    pro: 0.98,
  },
  fish10: {
    width: 178,
    height: 187,
    speed: 0.8,
    cost: 60,
    sumFrame: 10,
    pro: 0.99,
  },
};
let flashAtt_length = 10;
let flashCost_maxLength = 2;

// 炮筒的属性
let cannonAtt = {
  cannon1: {
    // 炮筒宽度
    width: 74,
    // 炮筒高度
    height: 74,
    // 炮筒对应子弹名称
    bullet: "bullet1",
  },
  cannon2: { width: 74, height: 76, bullet: "bullet2" },
  cannon3: { width: 74, height: 76, bullet: "bullet3" },
  cannon4: { width: 74, height: 83, bullet: "bullet4" },
  cannon5: { width: 74, height: 85, bullet: "bullet5" },
  cannon6: { width: 74, height: 90, bullet: "bullet6" },
  cannon7: { width: 74, height: 94, bullet: "bullet7" },
};
let cannonAtt_length = 7;

//子弹的属性
let bulletAtt = {
  bullet1: { width: 24, height: 26, speed: 10, range: 15, cost: 10 },
  bullet2: { width: 25, height: 29, speed: 9.75, range: 25, cost: 15 },
  bullet3: { width: 27, height: 31, speed: 9.5, range: 35, cost: 20 },
  bullet4: { width: 29, height: 33, speed: 9.25, range: 45, cost: 25 },
  bullet5: { width: 30, height: 34, speed: 9, range: 55, cost: 30 },
  bullet6: { width: 31, height: 35, speed: 8.75, range: 65, cost: 35 },
  bullet7: { width: 32, height: 38, speed: 8.5, range: 75, cost: 40 },
};

// 图形参数
let barWidth = 765; // 底部操作栏宽度
let barHeight = 72; // 底部操作栏高度
let scoreWidth = 20; // 数字图片中单个数字的裁剪宽度
let scoreHeight = 24; // 数字图片中单个数字的裁剪高度
let cannonWidth = 44; // 炮宽调整按钮图片的裁剪宽度
let cannonHeight = 31; // 炮宽调整按钮图片的裁剪高度
let coinTextWidth = 36;
let coinTextHeight = 49;
let coinWidth = 60;
let coinHeight = 60;
let energyWidth = 213; // 能量条图片裁剪宽度
let energyHeight = 19; // 能量条图片裁剪高度

// 游戏参数参数
let frequency = 20; // 添加鱼的频率（越小越快）
let coinTime = 10; // 硬币总帧数
let coinTextSpeed = 2;
let coinSpeed = 2; // 硬笔旋转速度
let coinLim = 25; // 分值分界
let energyMax = 2000; // 能量条最大临界值
let energySpeed = 5; // 能量条放能速度
let rewardFish = 25; // 用户能量条达到最大临界值后的奖励（放鱼数量）
